export const formatTime = (timestamp:number, format:string) => {
    if (!timestamp) return ''

    const date = new Date(timestamp)
    const padZero = (num:number) => num.toString().padStart(2, '0')

    return format
        .replace('YYYY', String(date.getFullYear()))
        .replace('MM', padZero(date.getMonth() + 1))
        .replace('DD', padZero(date.getDate()))
        .replace('HH', padZero(date.getHours()))
        .replace('mm', padZero(date.getMinutes()))
        .replace('ss', padZero(date.getSeconds()))
}